/**
 * Created by zzc on 2017/12/12
 */


'use strict'

import React from 'react';
import {
    StyleSheet,
    Image,
    View,
    Text,
    ViewPropTypes,
} from 'react-native';
import {deviceHeight, deviceWidth} from "../util/ScreenUtil";
import { AppStyles, AppSizes,AppColors} from '@theme/';
import Button from 'apsl-react-native-button';

export class ErrorView extends React.PureComponent {

    constructor(props) {
        console.log("*******ErrorView******"+props)
        super(props);
    }

    _onPress = () => {
        this.props.onPress();
    };

    render() {
        return (
            <View style={styles.container}>
                <Image resizeMode='center' source={this.props.imgSource} style={{height: 120, width: 120}}/>
                <Text style={[styles.text_desc, this.props.textStyle]}>{this.props.title}</Text>
                <View style={{alignItems: "center", justifyContent:"center"}}>
                    <Button
                        style={styles.btnContainer}
                        onPress={() => this._onPress()}
                        textStyle={styles.btn_text_style}>

                        轻点刷新
                    </Button>
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        flexDirection: 'column',
        alignItems: "center",
        justifyContent:"center"
    },
    btnContainer: {
        height: 30,
        width: 100,
        borderColor: "#FF3366",
        borderRadius: 3,
        borderWidth: 1,
    },
    text_desc: {
        fontSize: 14,
        color: '#666666',
        marginBottom: 10,
    },
    btn_text_style: {
        fontSize: 17,
        color: "#FF3366",
    },

});
